package com.msb.mall.core.dao.ware;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.msb.mall.core.entity.ware.WareSkuEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 *
 * @author leixu
 * @email xuleiwolf@163.com
 * @date 2024-04-19 20:31:49
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {

    void updateStock(@Param("skuId") Long skuId, @Param("wareId") Long wareId,
                     @Param("skuNum") Integer skuNum);

    Long getSkuStock(Long skuId);

    Integer lockSkuStock(@Param("skuId") Long skuId, @Param("wareId") Long wareId,
                         @Param("count") Integer count);

    List<WareSkuEntity> listHashStock(@Param("skuId") Long skuId);

}
